<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8" />
		<title>评价服务-{eyou:global name='web_name' /}</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
		<link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
		{eyou:static file="users/skin/css/bootstrap.min.css"/}
		{eyou:static file="users/skin/css/basic.css"/}
		{eyou:static file="users/skin/css/eyoucms.css"/}
		{eyou:static file="users/skin/css/shop.css"/}
		<!-- 新样式 2020-11-25 -->
		{eyou:static file="users/skin/css/element/index.css" /}
		{eyou:static file="users/skin/css/e-user.css" /}
		{eyou:include file="users/skin/css/diy_css.htm"/}

		{eyou:static file="/public/static/common/js/jquery.min.js"/}
		{eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
		{eyou:static file="/public/static/common/js/tag_global.js"/}
		<script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>

	</head>

	<body class="centre shop">
	<!-- 头部 -->
	{eyou:include file="users/users_header.htm" /}
	<!-- 头部结束 -->
    <div class="breadcrumbs">
        <div class="w1226">
            <a href="{eyou:global name='web_cmsurl'/}">首页</a> <span class="sep">/</span> <a href="{eyou:url link='user/Users/index' /}">会员中心</a> <span class="sep">/</span> <span>评价服务</span>
        </div>
    </div>

	<div class="ey-body-bg">
		<div class="ey-body pd0">
			<div class="ey-container w1226">
				<!-- 侧边 -->
				{eyou:include file="users/users_left.htm" /}
				<!-- 侧边结束 -->
				<div class="ey-con mi-comment xin_mian fr">
					<h1>评价服务</h1>

					<div class="appraise-list">
						<form id="post_form">
							<input type="hidden" name="order_id" value="{$eyou.field.order.order_id}" />
							<input type="hidden" name="order_code" value="{$eyou.field.order.order_code}" />
						{eyou:volist name="$eyou.field.goods" id="vo"}

						<div class="item">
							<div class="item-l">
								<div class="img"><a href="{$vo.arcurl}"><img src="{$vo.litpic}" ></a></div>
								<a class="title">
									{$vo.product_name}&nbsp;
                                    <!-- 商品规格 -->
                                    {eyou:volist name='$vo.product_spec_list' id='spec'}
                                        {$spec.value}&nbsp;
                                    {/eyou:volist}
                                    <!-- 商品规格 END-->
								</a>
							</div>
							<div class="item-r">
								<div class="item-r-t">
									<div class="item-from-row">
										<input type="hidden" class="text" name="details_id[{$vo.details_id}]" value="{$vo.details_id}">
										<input type="hidden" class="text" name="product_id[{$vo.details_id}]" value="{$vo.product_id}">

										<label class="radio-label">
											<span>好评</span>
											<input type="radio" class="radio" name="total_score[{$vo.details_id}]" value="1" >
											<span class="check-mark"></span>
										</label>
										<label class="radio-label">
											<span>中评</span>
											<input type="radio" class="radio" name="total_score[{$vo.details_id}]" value="2">
											<span class="check-mark"></span>
										</label>
										<label class="radio-label">
											<span>差评</span>
											<input type="radio" class="radio" name="total_score[{$vo.details_id}]" value="3">
											<span class="check-mark"></span>
										</label>

									</div>
								</div>
								<div class="item-r-m">
									<textarea class="el-input__inner" name="content[{$vo.details_id}]" style="min-height:110px;" rows="3" placeholder="商品是否给力？快分享你的购买心得吧~"></textarea>
								</div>

								<div class="item-r-b" id="dl_upload_img_{$vo.details_id}">
									<div class="images_upload_main">
										<a href="javascript:void(0);" id="UploadImgA{$vo.details_id}" onclick="GetTriggerUpload{$vo.details_id}(this, 'UploadImgCallBack_{$vo.details_id}');" data-num="6" class="el-button el-button--primary is-plain el-button--small"><i class="el-icon-picture"></i>上传图片</a>
										<span style="color: #b7aeae;">限6张</span>
										<div class="sort-list mt20 ui-sortable">
											<div class="fieldext_upload fieldext_upload_{$vo.details_id} ui-sortable-handle" style="display: none;"></div>
										</div>
									</div>

									<!-- 上传图片显示的样板 start -->
									<div class="upload_img_upload_tpl_{$vo.details_id}" style="display: none;">
										<div class="fieldext_upload fieldext_upload_{$vo.details_id}">
											<div class="images_upload_item" style="width: 105px; height: 105px;">
												<input type="hidden" name="upload_img[{$vo.details_id}][]" >
												<a href="javascript:void(0);">
													<img src="" style="width: 105px; height: 105px;">
												</a>
												<a class="delete" href="javascript:void(0)">&nbsp;&nbsp;</a>
											</div>
										</div>
									</div>
									<!-- 上传图片显示的样板 end -->
									<script>
                                        // 上传多图回调函数
                                        function UploadImgCallBack_{$vo.details_id}(paths) {
                                            var last_div = $(".upload_img_upload_tpl_{$vo.details_id}").html();
                                            var obj = $('#dl_upload_img_{$vo.details_id}');
                                            for (var i = 0; i < paths.length; i++) {
                                                // 若可上传数量为0则执行返回
                                                var num = obj.attr('data-numlimit');
                                                if (0 == num) return false;
                                                num = Number(num) - 1;
                                                obj.attr('data-numlimit', num);
                                                // 拼装图片
                                                obj.find(".fieldext_upload_{$vo.details_id}:eq(0)").before(last_div);
                                                obj.find(".fieldext_upload_{$vo.details_id}:eq(0)").find('input').val(paths[i]);
                                                obj.find(".fieldext_upload_{$vo.details_id}:eq(0)").find('a:eq(0)').attr('href', paths[i]).attr('target', "_blank");
                                                obj.find(".fieldext_upload_{$vo.details_id}:eq(0)").find('img').attr('src', paths[i]);
                                                obj.find(".fieldext_upload_{$vo.details_id}:eq(0)").find('a:eq(1)').attr('onclick',"UploadImgDel_{$vo.details_id}(this, '"+paths[i]+"')").text('');
                                            }
                                            var count = $('#UploadImgA{$vo.details_id}').attr('data-num');
                                            $('#UploadImgA{$vo.details_id}').attr('data-num',(count-paths.length));
                                        }

                                        // 上传之后删除组图input
                                        function UploadImgDel_{$vo.details_id}(obj, path) {
                                            $(obj).parent().remove();
                                            $.ajax({
                                                type:'POST',
                                                url:"{:url('user/Uploadify/delupload', ['_ajax'=>1])}",
                                                data:{action:"del", filename:path},
                                                success:function(){
                                                    var img_obj = $('#dl_upload_img_{$vo.details_id}');
                                                    var num = img_obj.attr('data-numlimit');
                                                    num = Number(num) + 1;
                                                    img_obj.attr('data-numlimit', num);
                                                    var count = $('#UploadImgA{$vo.details_id}').attr('data-num');
                                                    $('#UploadImgA{$vo.details_id}').attr('data-num',(count+1));
                                                }
                                            });
                                        }
                                        function GetTriggerUpload{$vo.details_id}(obj,method) {
                                            var n = $(obj).attr('data-num');
                                            GetUploadify(n, '', 'allimg', method, '', '评价晒单');
                                        }
									</script>
								</div>
							</div>
						</div>

						{/eyou:volist}
							<div class="order-progress-con" style="margin-left: 190px;margin-top: 20px;">
								<input type="button" onclick="SubmitData(this);" data-url="{$eyou.SubmitUrl}" class="el-button el-button--primary " value="确认提交"/>
							</div>
						</form>

					</div>
				</div>

			</div>
		</div>
	</div>
	<script type="text/javascript">
        // 提交申请
        function SubmitData(obj) {
            layer_loading('正在处理');
            $.ajax({
                url: $(obj).data('url'),
                data: $('#post_form').serialize(),
                type:'post',
                dataType:'json',
                success:function(res) {
                    layer.closeAll();
                    if (1 == res.code) {
                        layer.msg(res.msg, {time: 1500}, function() {
                            window.location.href = res.url;
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                },
                error : function() {
                    layer.closeAll();
                    layer.alert('未知错误！', {title: false, icon: 5, closeBtn: 0});
                }
            });
        }

        /** 以下 图集相册的拖动排序相关 js*/
        $( ".sort-list" ).sortable({
            start: function( event, ui) {},
            stop: function( event, ui ) {}
        });
        $( ".sort-list" ).disableSelection();
	</script>
{eyou:include file="users/users_footer.htm" /}
